<%@page import="models.config.ServiceConfigModel"%>
<%@page import="com.google.appengine.api.blobstore.BlobKey"%>
<%@page import="com.google.appengine.api.images.ImagesServiceFactory"%>
<%@page import="com.google.appengine.api.images.ImagesService"%>
<%@page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory"%>
<%@page import="com.google.appengine.api.blobstore.BlobstoreService"%>
<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>

<%
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
TreeMap check = (TreeMap) request.getAttribute("check");
String success = (String) request.getAttribute("success");
ServiceConfigModel configs = (ServiceConfigModel) request.getAttribute("configs");
String form = (String) request.getAttribute("form");

ImagesService imagesService = ImagesServiceFactory.getImagesService();

%>

<jsp:include page="/admin/layouts/header.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>
<script type="text/javascript" src="/admin/js/configs/form_source_url.js"></script>
	<% if (success != null) {%>
	<div class="success block" ><%=success %></div>
	<% } %>
	<div class="block">
		<form id="edit_config_form" action="" method="post">
			<div id="add_items">
				<table class="formPage">
					<thead>
						<tr>
							<th colspan="2">
								Url Source Config
							</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td class="label"><label for="c_urlWhois">Whois Url:</label></td>
							<td class="smallDesc type">
								<% if (check.get("urlWhois") != null) { %>
									<span class="error"><%=check.get("urlWhois") %></span>
								<% } %>
								<input id="c_urlWhois" class="text" type="text" name="urlWhois" value="<%=configs.getUrlWhois() != null ? configs.getUrlWhois() : "" %>" maxlength="100">
								<div class="description">Url for get info whois a domain.</div>
							</td>
						</tr>
						<tr>
							<td class="label"><label for="c_urlIpAddress">Ip Address Url:</label></td>
							<td class="smallDesc type">
								<% if (check.get("urlIpAddress") != null) { %>
									<span class="error"><%=check.get("urlIpAddress") %></span>
								<% } %>
								<input id="c_urlIpAddress" class="text" type="text" name="urlIpAddress" value="<%=configs.getUrlIpAddress() != null ? configs.getUrlIpAddress() : "" %>" maxlength="100">
								<div class="description">Url for get info ip addres a domain.</div>
							</td>
						</tr>
						<tr>
							<td class="label"><label for="c_urlAlexa">Alexa Url:</label></td>
							<td class="smallDesc type">
								<% if (check.get("urlAlexa") != null) { %>
									<span class="error"><%=check.get("urlAlexa") %></span>
								<% } %>
								<input id="c_urlAlexa" class="text" type="text" name="urlAlexa" value="<%=configs.getUrlAlexa() != null ? configs.getUrlAlexa() : "" %>" maxlength="100">
								<div class="description">Url for get info alexa rank a domain.</div>
							</td>
						</tr>
						<tr>
							<td class="label"><label for="c_urlGoogleRank">Url Google Rank:</label></td>
							<td class="smallDesc type">
								<% if (check.get("urlGoogleRank") != null) { %>
									<span class="error"><%=check.get("urlGoogleRank") %></span>
								<% } %>
								<input id="c_urlGoogleRank" class="text" type="text" name="urlGoogleRank" value="<%=configs.getUrlGoogleRank() != null ? configs.getUrlGoogleRank() : "" %>" maxlength="100">
								<div class="description">Url for get info google rank a domain.</div>
							</td>
						</tr>
						<tr>
							<td class="label"><label for="c_urlAgeDomain">Url Age Domain:</label></td>
							<td class="smallDesc type">
								<% if (check.get("urlAgeDomain") != null) { %>
									<span class="error"><%=check.get("urlAgeDomain") %></span>
								<% } %>
								<input id="c_urlAgeDomain" class="text" type="text" name="urlAgeDomain" value="<%=configs.getUrlAgeDomain() != null ? configs.getUrlAgeDomain() : "" %>" maxlength="100">
								<div class="description">Url for get info age domain.</div>
							</td>
						</tr>
						<tr>
							<td class="label"><label for="c_urlValidator">Url Validator:</label></td>
							<td class="smallDesc type">
								<% if (check.get("urlValidator") != null) { %>
									<span class="error"><%=check.get("urlValidator") %></span>
								<% } %>
								<input id="c_urlValidator" class="text" type="text" name="urlValidator" value="<%=configs.getUrlValidator() != null ? configs.getUrlValidator() : "" %>" maxlength="100">
								<div class="description">Url for get info age domain.</div>
							</td>
						</tr>
						<tr>
							<td class="label"><label for="c_urlGoogleService">Url Google Service:</label></td>
							<td class="smallDesc type">
								<% if (check.get("urlGoogleService") != null) { %>
									<span class="error"><%=check.get("urlGoogleService") %></span>
								<% } %>
								<input id="c_urlGoogleService" class="text" type="text" name="urlGoogleService" value="<%=configs.getUrlGoogleService() != null ? configs.getUrlGoogleService() : "" %>" maxlength="100">
								<div class="description">Url for get info google adsence domain, google analytic domain...</div>
							</td>
						</tr>
					</tbody>
				</table>
				
				<table class="formPage">
					<tfoot>
						<tr>
							<td><input type="reset" class="button" title="Reset form" alt="Reset form" value="Reset" name="reset" id="reset-user-submit"></td>
							<td><input type="submit" class="button" title="Save link" alt="Save form" value="Save" name="save" id="send-user-submit"></td>
						</tr>
					</tfoot>
				</table>
			</div>
		</form>
	</div>

<jsp:include page="/admin/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>